package com.deyuanyun.pic.pbf.controller.dto.defect.node;

import com.deyuanyun.pic.common.util.ObjectUtil;
import com.deyuanyun.pic.common.util.format.NumberFormat;
import com.deyuanyun.pic.pbf.domain.CoatSurvey;
import com.deyuanyun.pic.settings.support.biz.CodeUtil;

/**
 * 3,防腐层调查记录表
 *
 * @author huanglw
 * @date 2016-7-5
 *
 * History: [修改人][时间][修改描述]
 */
public class CoatSurveyDto extends NodeDto {

    /**
     * 防腐层类型：2PE；3PE；环氧粉末；粘弹体+外保护带；液态环氧+热收缩套/带；聚乙烯胶粘带；溶剂型液态环氧；双层熔结环氧树脂；双层环氧树脂；煤焦油瓷漆；环氧煤沥青；石油沥青；保温层；其它
     */
    private String coatingMaterial;

    /**
     * 外观质量：很好；少量破损；大面积破损；无防腐层；其它
     */
    private String appearance;

    /**
     * 电火花检测-检查电压（KV）
     */
    private String electricSparkTestVoltage;

    /**
     * 电火花检测-漏点数
     */
    private String electricSparkAmount;

    /**
     * 管体温度
     */
    private String pipeBodyTemperature;

    /**
     * 氧化还原电位（-mV）
     */
    private String redoxPotential;

    /**
     * 剥离强度（N/cm）-测试1
     */
    private String peelingStrengthTest1;

    /**
     * 剥离强度（N/cm）-测试2
     */
    private String peelingStrengthTest2;

    /**
     * 剥离强度（N/cm）-测试3
     */
    private String peelingStrengthTest3;

    /**
     * 剥离强度（N/cm）-测试4
     */
    private String peelingStrengthTest4;

    /**
     * 厚度（mm）-测试1
     */
    private String coatingThicknessTest1;

    /**
     * 厚度（mm）-测试2
     */
    private String coatingThicknessTest2;

    /**
     * 厚度（mm）-测试3
     */
    private String coatingThicknessTest3;

    /**
     * 厚度（mm）-测试4
     */
    private String coatingThicknessTest4;

    /**
     * 是否需要换管：0，不需要；1，需要
     */
    private String isPipeReplacement;

    /**
     * 是否完成该节点任务：0，没有完成；1，已经完成
     */
    private Short isCompletion;

    public CoatSurveyDto(Short isCompletion) {
        this.isCompletion = isCompletion;
    }

    public Short getIsCompletion() {
        return isCompletion;
    }

    public void setIsCompletion(Short isCompletion) {
        this.isCompletion = isCompletion;
    }


    public String getCoatingMaterial() {
        return coatingMaterial;
    }

    public void setCoatingMaterial(String coatingMaterial) {
        this.coatingMaterial = coatingMaterial;
    }

    public String getAppearance() {
        return appearance;
    }

    public void setAppearance(String appearance) {
        this.appearance = appearance;
    }

    public String getElectricSparkTestVoltage() {
        return electricSparkTestVoltage;
    }

    public void setElectricSparkTestVoltage(String electricSparkTestVoltage) {
        this.electricSparkTestVoltage = electricSparkTestVoltage;
    }

    public String getElectricSparkAmount() {
        return electricSparkAmount;
    }

    public void setElectricSparkAmount(String electricSparkAmount) {
        this.electricSparkAmount = electricSparkAmount;
    }

    public String getPipeBodyTemperature() {
        return pipeBodyTemperature;
    }

    public void setPipeBodyTemperature(String pipeBodyTemperature) {
        this.pipeBodyTemperature = pipeBodyTemperature;
    }

    public String getRedoxPotential() {
        return redoxPotential;
    }

    public void setRedoxPotential(String redoxPotential) {
        this.redoxPotential = redoxPotential;
    }

    public String getPeelingStrengthTest1() {
        return peelingStrengthTest1;
    }

    public void setPeelingStrengthTest1(String peelingStrengthTest1) {
        this.peelingStrengthTest1 = peelingStrengthTest1;
    }

    public String getPeelingStrengthTest2() {
        return peelingStrengthTest2;
    }

    public void setPeelingStrengthTest2(String peelingStrengthTest2) {
        this.peelingStrengthTest2 = peelingStrengthTest2;
    }

    public String getPeelingStrengthTest3() {
        return peelingStrengthTest3;
    }

    public void setPeelingStrengthTest3(String peelingStrengthTest3) {
        this.peelingStrengthTest3 = peelingStrengthTest3;
    }

    public String getPeelingStrengthTest4() {
        return peelingStrengthTest4;
    }

    public void setPeelingStrengthTest4(String peelingStrengthTest4) {
        this.peelingStrengthTest4 = peelingStrengthTest4;
    }

    public String getCoatingThicknessTest1() {
        return coatingThicknessTest1;
    }

    public void setCoatingThicknessTest1(String coatingThicknessTest1) {
        this.coatingThicknessTest1 = coatingThicknessTest1;
    }

    public String getCoatingThicknessTest2() {
        return coatingThicknessTest2;
    }

    public void setCoatingThicknessTest2(String coatingThicknessTest2) {
        this.coatingThicknessTest2 = coatingThicknessTest2;
    }

    public String getCoatingThicknessTest3() {
        return coatingThicknessTest3;
    }

    public void setCoatingThicknessTest3(String coatingThicknessTest3) {
        this.coatingThicknessTest3 = coatingThicknessTest3;
    }

    public String getCoatingThicknessTest4() {
        return coatingThicknessTest4;
    }

    public void setCoatingThicknessTest4(String coatingThicknessTest4) {
        this.coatingThicknessTest4 = coatingThicknessTest4;
    }

    public String getIsPipeReplacement() {
        return isPipeReplacement;
    }

    public void setIsPipeReplacement(String isPipeReplacement) {
        this.isPipeReplacement = isPipeReplacement;
    }

    public void fromDomain(CoatSurvey domain) {

        if (ObjectUtil.isEmptyAll(domain)) {
            return;
        }

        // 防腐层类型
        this.coatingMaterial = CodeUtil.getName(domain.getCoatingMaterial());
        // 外观质量
        this.appearance = CodeUtil.getName(domain.getAppearance());
        // 电火花检测-检查电压（KV）
        this.electricSparkTestVoltage = NumberFormat.format(domain.getElectricSparkTestVoltage());
        // 电火花检测-漏点数
        this.electricSparkAmount = NumberFormat.format(domain.getElectricSparkAmount());
        // 管体温度
        this.pipeBodyTemperature = NumberFormat.format(domain.getPipeBodyTemperature());
        // 氧化还原电位（-mV）
        this.redoxPotential = NumberFormat.format(domain.getRedoxPotential());
        // 剥离强度（N/cm）-0点方向
        this.peelingStrengthTest1 = NumberFormat.format(domain.getPeelingStrengthTest1());
        // 剥离强度（N/cm）-3点方向
        this.peelingStrengthTest2 = NumberFormat.format(domain.getPeelingStrengthTest2());
        // 剥离强度（N/cm）-6点方向
        this.peelingStrengthTest3 = NumberFormat.format(domain.getPeelingStrengthTest3());
        // 剥离强度（N/cm）-9点方向
        this.peelingStrengthTest4 = NumberFormat.format(domain.getPeelingStrengthTest4());
        // 厚度（mm）-0点方向
        this.coatingThicknessTest1 = NumberFormat.format(domain.getCoatingThicknessTest1());
        // 厚度（mm）-3点方向
        this.coatingThicknessTest2 = NumberFormat.format(domain.getCoatingThicknessTest2());
        // 厚度（mm）-6点方向
        this.coatingThicknessTest3 = NumberFormat.format(domain.getCoatingThicknessTest3());
        // 厚度（mm）-9点方向
        this.coatingThicknessTest4 = NumberFormat.format(domain.getCoatingThicknessTest4());
        // 是否需要换管
        this.isPipeReplacement = (domain.getIsPipeReplacement()!=null && domain.getIsPipeReplacement()==1) ? "需要" : "不需要";

        // 赋值
        super.fromDomain(domain.getId(), domain.getCreateRemark());
    }
}